/*
 * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package javax.swing;

import java.awt.*;
import java.awt.image.*;

/**
 * ImageObserver for DebugGraphics, used for images only.
 *
 * @author Dave Karlton
 */
class DebugGraphicsObserver implements ImageObserver {

  int lastInfo;

  synchronized boolean allBitsPresent() {
    return (lastInfo & ImageObserver.ALLBITS) != 0;
  }

  synchronized boolean imageHasProblem() {
    return ((lastInfo & ImageObserver.ERROR) != 0 ||
        (lastInfo & ImageObserver.ABORT) != 0);
  }

  public synchronized boolean imageUpdate(Image img, int infoflags,
      int x, int y,
      int width, int height) {
    lastInfo = infoflags;
    return true;
  }
}
